<?php
namespace Tbf\Bundle\PackageBundle\Annotation;
class Annotation
{
    protected $class_name;
    protected $attr;
    public function __construct($class_name,$attr=array())
    {
        $this->class_name = ltrim($class_name,'\\');
        $this->attr = $attr;
    }
    public function __toString()
    {
        $output = '@'.$this->class_name.'('.$this->getStringAttr().')';

        return $output;
    }
    public function getStringAttr()
    {
        $output = array();
        foreach ($this->attr as $name=>$value) {
            $output[] = $name.'="'.$value.'"';
        }

        return implode(', ',$output);
    }
}
